// src/main/java/com/bookmanager/model/Favorite.java
package com.bookmanager.model;

import java.time.LocalDateTime;

public class Favorite {
    private Integer favoriteId;
    private String userId;
    private Integer bookId;
    private LocalDateTime createTime;

    // 关联信息
    private Book book;
    private String bookTitle;
    private String bookAuthor;

    // 构造方法
    public Favorite() {}

    public Favorite(String userId, Integer bookId) {
        this.userId = userId;
        this.bookId = bookId;
    }

    // Getter和Setter方法
    public Integer getFavoriteId() { return favoriteId; }
    public void setFavoriteId(Integer favoriteId) { this.favoriteId = favoriteId; }

    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }

    public Integer getBookId() { return bookId; }
    public void setBookId(Integer bookId) { this.bookId = bookId; }

    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }

    public Book getBook() { return book; }
    public void setBook(Book book) { this.book = book; }

    public String getBookTitle() { return bookTitle; }
    public void setBookTitle(String bookTitle) { this.bookTitle = bookTitle; }

    public String getBookAuthor() { return bookAuthor; }
    public void setBookAuthor(String bookAuthor) { this.bookAuthor = bookAuthor; }
}